package com.yc.creationType.prototype.imp;

import com.yc.creationType.prototype.ICloneable;

/**
 * 摘要，场景制作简历，使用原型模式，只有部分的属性需要修改的
 */
public class Resume implements ICloneable, Cloneable {

	private String name;
	private String sex;
	private Integer age;

	private String timeArea;
	private String company;

	public Resume() {
		this.name = name;
	}

	public Resume(String name) {
		this.name = name;
	}

	public void SetPersonInfo(String sex, Integer age) {
		this.sex = sex;
		this.age = age;
	}

	public void SetWorkExperice(String timeArea, String company) {
		this.timeArea = timeArea;
		this.company = company;
	}

	@Override
	public void display() {
		System.out.println("姓名：" +  name + "；年龄:" + age + "；时间：" + timeArea + "；公司：" + company);
	}

	public static void main(String[] args) throws CloneNotSupportedException {
		Resume a = new Resume("张三");
		a.SetPersonInfo("男", 24);
		a.SetWorkExperice("1993-2009", "xx超大公司");

		Resume b = (Resume) a.clone();
		b.SetWorkExperice("2009-2010", "xx小公司");

		Resume c = (Resume) a.clone();
		c.SetWorkExperice("2010-2022", "fsfsfsf");

		a.display();
		b.display();
		c.display();
	}
}
